<template>
  <div class="home">
    <el-container>
      <el-header>
        <div class="title">旅梦管理系统</div>
        <div class="info">
          <el-dropdown>
            <span class="el-dropdown-link">
              {{ userName }}<i class="el-icon-arrow-down el-icon--right"></i>
            </span>
            <el-dropdown-menu slot="dropdown">
              <el-dropdown-item>修改密码</el-dropdown-item>
              <el-dropdown-item>退出登陆</el-dropdown-item>
            </el-dropdown-menu>
          </el-dropdown>
        </div>
      </el-header>
      <el-container>
        <el-aside width="200px">
          <el-menu
            default-active="/home/userinfo"
            class="el-menu-vertical-demo"
            background-color="#d3dce6"
            text-color="#333"
            router
          >
            <el-submenu index="1">
              <template slot="title">
                <i class="el-icon-location"></i>
                <span>学生列表</span>
              </template>
              <el-menu-item index="/home/userinfo">
                <i class="el-icon-menu"></i>
                <span slot="title">学生一</span>
              </el-menu-item>
              <el-menu-item index="/home/form">
                <i class="el-icon-menu"></i>
                <span slot="title">学生二</span>
              </el-menu-item>
              <el-menu-item index="">
                <i class="el-icon-menu"></i>
                <span slot="title">学生三</span>
              </el-menu-item>
              <el-menu-item index="">
                <i class="el-icon-menu"></i>
                <span slot="title">学生四</span>
              </el-menu-item>
            </el-submenu>
            <el-menu-item index="/home/2">
              <i class="el-icon-menu"></i>
              <span slot="title">作业情况</span>
            </el-menu-item>
          </el-menu>
        </el-aside>
        <el-main>
          <router-view></router-view>
        </el-main>
      </el-container>
    </el-container>
  </div>
</template>

<script>
export default {
  data() {
    return {
      userName: this.$route.query.userName,
    };
  },
};
</script>

<style>
.is-vertical .el-container {
  height: calc(100vh - 60px);
}
.el-header {
  background-color: #b3c0d1;
  color: #333;
  text-align: center;
  line-height: 60px;
}

.el-aside {
  background-color: #d3dce6;
  color: #333;
  text-align: center;
  line-height: 200px;
}

.el-main {
  background-color: #e9eef3;
  color: #333;
  text-align: center;
  line-height: 160px;
}
.el-dropdown-link {
  cursor: pointer;
  color: #333;
}
.el-icon-arrow-down {
  font-size: 12px;
}

.title {
  float: left;
}
.info {
  float: right;
}

.el-menu {
  height: 100%;
}
</style>